package com.yunti.business.service.impl;

import java.time.LocalDateTime;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yunti.business.mapper.RaceGroupMapper;
import com.yunti.business.domain.RaceGroup;
import com.yunti.business.service.IRaceGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 组别Service业务层处理
 *
 * @author yangtt
 * @date 2024-11-25
 */
@Service
public class RaceGroupServiceImpl   extends ServiceImpl<RaceGroupMapper, RaceGroup> implements IRaceGroupService{
    @Autowired
    private RaceGroupMapper raceGroupMapper;

    /**
     * 查询组别
     *
     * @param id 组别主键
     * @return 组别
     */
    @Override
    public RaceGroup selectRaceGroupById(Long id)
    {
        return raceGroupMapper.selectRaceGroupById(id);
    }

    /**
     * 查询组别列表
     *
     * @param raceGroup 组别
     * @return 组别
     */
    @Override
    public List<RaceGroup> selectRaceGroupList(RaceGroup raceGroup)
    {
        return raceGroupMapper.selectRaceGroupList(raceGroup);
    }

    /**
     * 新增组别
     *
     * @param raceGroup 组别
     * @return 结果
     */
    @Override
    public int insertRaceGroup(RaceGroup raceGroup)
    {
        raceGroup.setCreateTime(LocalDateTime.now());
        return raceGroupMapper.insertRaceGroup(raceGroup);
    }

    /**
     * 修改组别
     *
     * @param raceGroup 组别
     * @return 结果
     */
    @Override
    public int updateRaceGroup(RaceGroup raceGroup)
    {
        raceGroup.setUpdateTime(LocalDateTime.now());
        return raceGroupMapper.updateRaceGroup(raceGroup);
    }

    /**
     * 批量删除组别
     *
     * @param ids 需要删除的组别主键
     * @return 结果
     */
    @Override
    public int deleteRaceGroupByIds(Long[] ids)
    {
        return raceGroupMapper.deleteRaceGroupByIds(ids);
    }

    /**
     * 删除组别信息
     *
     * @param id 组别主键
     * @return 结果
     */
    @Override
    public int deleteRaceGroupById(Long id)
    {
        return raceGroupMapper.deleteRaceGroupById(id);
    }
}
